package ha.web.client.servlet.login;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/Login")
public class Login extends HttpServlet {
    
	/**
	 * 
	 */
	private static final long serialVersionUID = -2746717494090466959L;

	/**
     * @see HttpServlet#HttpServlet()
     */
    public Login() {
    	super();
    }
    
    /**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	public void doPost(HttpServletRequest request, HttpServletResponse response)   
    		throws IOException, ServletException {
		doGet(request, response);
    }
    
	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    		throws IOException, ServletException {
    	PrintWriter out = response.getWriter();
    	out.print("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">");
		out.print("<HTML><HEAD><TITLE>login page</TITLE>");
		out.print("<link rel=\"stylesheet\" type=\"text/css\" href=\"gameDesign.css\" />");
		out.print("<META http-equiv=Content-Type content=\"text/html\">");
		out.print("</HEAD>");
		out.print("<BODY>");
		out.print("<P>");
		out.print("<DIV align=\"center\">");
		out.print("<h2>Welcome to Chinese Checkers game<br><br>");
		out.print("please log in to continue</h2>");
		out.print("<form action=\"WaitingPage\" method=\"post\">");
		out.print("Name:<input type=\"text\" name=\"user\"><br><br>");
		out.print("Password:<input type=\"password\" name=\"pass\"><br><br>");
		out.print("<input type=\"submit\" class=\"button\" value=\"Submit\"><br>");
		out.print("</FORM>");
		out.print("<form action=\"register\"  method=\"get\">");
		out.print("<input type=\"submit\" class=\"button\" name=\"register\" value=\"Register\">");
		out.print("</FORM>");
		out.print("</DIV>");
		out.print("<P></P>");
		out.print("</BODY></HTML>");

    }
    
}

